home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / U-Utilities / (c)u1.d64 / joy 2.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  567b  |  36 lines

  1. 10 REM    JOY2
  2. 110 GOSUB380
  3. 130 GOSUB330:REM   READ JOYSTICK
  4. 150 YY=YY+UD(JD)
  5. 160 XX=XX+LR(JD)
  6. 170 IFYY<0THENYY=24
  7. 180 IFYY>24THENYY=0
  8. 190 IFXX<0THENXX=39
  9. 200 IFXX>39THENXX=0
  10. 210 POKERP,0
  11. 220 POKERX,YY
  12. 230 POKERY,XX
  13. 240 IF((XX=39)AND(YY=24))THEN130
  14. 250 SYS CU :REM  LOG CURSOR
  15. 260 PRINTCH$;
  16. 270 IFBT=16THEN300
  17. 280 FORTT=1TO6
  18. 290 PRINTCHR$(157)CHR$(32)
  19. 300 GETIN$:IFIN$<>""THENCH$=IN$
  20. 310 GOTO130
  21. 330 JP=PEEK(J1)
  22. 340 BT=JPAND16
  23. 350 JD=15-(JPAND15)
  24. 360 RETURN
  25. 380 PRINTCHR$(147)
  26. 400 FORK=0TO10
  27. 410 READUD(K),LR(K)
  28. 420 NEXT
  29. 440 CU=65520:J1=56320
  30. 470 XX=20:YY=12
  31. 480 CH$=CHR$(113)
  32. 490 RX=781:RY=782:RP=783
  33. 500 RETURN
  34. 520 DATA 0,0,-1,0,1,0,0,0,0,-1
  35. 580 DATA -1,-1,1,-1,0,0,0,1,-1,1,1,1
  36.